from flask import Flask

import settings
from app.user import user_bp
from ext import db


def create_app():
    app = Flask(__name__, template_folder='../templates', static_folder='../static')
    app.config.from_object(settings.DevelopmentConfig)
    # 注册蓝图到app
    app.register_blueprint(user_bp)
    # 绑定数据库到app中
    db.init_app(app)
    return app
